package com.yuque.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yuque.dao.UserDao;
import com.yuque.pojo.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserDao userDao;
    @Override
    public int zhuce(user user) {
        int i = userDao.insert(user);
        return i;
    }

    @Override
    public user denglu(user user) {
        QueryWrapper<user> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("username", user.getUsername());
        queryWrapper.eq("password",user.getPassword());
   user user1 = userDao.selectOne(queryWrapper);


        return user1;
    }

    @Override
    public int chaxun(user user) {
        int i = userDao.updateById(user);
        return i;
    }

}
